package com.ruoyi.merchant.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.merchant.mapper.DeviceCategoryMapper;
import com.ruoyi.merchant.domain.DeviceCategory;
import com.ruoyi.merchant.service.IDeviceCategoryService;

/**
 * 设备类别Service业务层处理
 * 
 * @author chengxin.ju
 * @date 2023-12-12
 */
@Service
public class DeviceCategoryServiceImpl implements IDeviceCategoryService 
{
    @Autowired
    private DeviceCategoryMapper deviceCategoryMapper;

    /**
     * 查询设备类别
     * 
     * @param id 设备类别主键
     * @return 设备类别
     */
    @Override
    public DeviceCategory selectDeviceCategoryById(String id)
    {
        return deviceCategoryMapper.selectDeviceCategoryById(id);
    }

    /**
     * 查询设备类别列表
     * 
     * @param deviceCategory 设备类别
     * @return 设备类别
     */
    @Override
    public List<DeviceCategory> selectDeviceCategoryList(DeviceCategory deviceCategory)
    {
        return deviceCategoryMapper.selectDeviceCategoryList(deviceCategory);
    }

    /**
     * 新增设备类别
     * 
     * @param deviceCategory 设备类别
     * @return 结果
     */
    @Override
    public int insertDeviceCategory(DeviceCategory deviceCategory)
    {
        deviceCategory.setCreateTime(DateUtils.getNowDate());
        return deviceCategoryMapper.insertDeviceCategory(deviceCategory);
    }

    /**
     * 修改设备类别
     * 
     * @param deviceCategory 设备类别
     * @return 结果
     */
    @Override
    public int updateDeviceCategory(DeviceCategory deviceCategory)
    {
        return deviceCategoryMapper.updateDeviceCategory(deviceCategory);
    }

    /**
     * 批量删除设备类别
     * 
     * @param ids 需要删除的设备类别主键
     * @return 结果
     */
    @Override
    public int deleteDeviceCategoryByIds(String[] ids)
    {
        return deviceCategoryMapper.deleteDeviceCategoryByIds(ids);
    }

    /**
     * 删除设备类别信息
     * 
     * @param id 设备类别主键
     * @return 结果
     */
    @Override
    public int deleteDeviceCategoryById(String id)
    {
        return deviceCategoryMapper.deleteDeviceCategoryById(id);
    }

    @Override
    public List<DeviceCategory> deviceCtegoryList(DeviceCategory deviceCategory) {
        return deviceCategoryMapper.deviceCtegoryList(deviceCategory);
    }
}
